package ed.hbut.supermarket1.controller;

import ed.hbut.supermarket1.entity.Result;
import ed.hbut.supermarket1.service.EmpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
public class LoginController {

    @Autowired
    public EmpService empService;

    @GetMapping("/api/login/{username}")
    public Result login(@PathVariable String username) {

         String password= empService.login(username);
        log.info("密码为："+password);
        return Result.success(password);
    }

}
